package com.dream.service.impl;

import com.dream.dao.DepartmentDao;
import com.dream.dao.impl.DepartmentDaoImpl;
import com.dream.pojo.Department;
import com.dream.service.DepartmentService;

import java.util.List;

public class DepartmentServiceImpl implements DepartmentService {

    DepartmentDao departmentDao = new DepartmentDaoImpl();
    @Override
    public long totalCount(String deptName) {
        return departmentDao.totalCount(deptName);
    }

    @Override
    public List<Department> list(String deptName, long pageIndex, long pageSize) {
        return departmentDao.list(deptName,pageIndex,pageSize);
    }

    @Override
    public int add(Department department) {
        return departmentDao.add(department);
    }

    @Override
    public Department findById(String deptId) {
        return departmentDao.findById(deptId);
    }

    @Override
    public int update(Department department) {
        return departmentDao.update(department);
    }

    @Override
    public int deleteById(String deptId) {
        return departmentDao.deleteById(deptId);
    }

    @Override
    public List<Department> getAllDept() {
        return departmentDao.getAllDept();
    }
}
